package DanLiMoShi;

public class Lazy {
    private Lazy(){

    }

    private static Lazy lazy = null;

    public static Lazy getInstance(){
        if(lazy == null){
            lazy = new Lazy();
        }
        return lazy;
    }
}
class test1{
    public static void main(String[] args) {
        Lazy lazy1 = Lazy.getInstance();
        Lazy lazy2 = Lazy.getInstance();
        System.out.println(lazy1==lazy2);
        System.out.println(lazy1.equals(lazy2));
        System.out.println(lazy1.hashCode()+"===="+lazy2.hashCode());
    }
}